package com.twu.biblioteca;

public class Book {
    private final String title;
    private final String author;
    private final int number;

    public Book(int number, String title, String author) {
        this.number = number;
        this.title = title;
        this.author = author;
    }

    public String title() {
        return this.title;
    }

    public int number() {
        return number;
    }

    @Override
    public boolean equals(Object obj) {
        Book other = (Book) obj;
        if(other == null || !this.getClass().equals(other.getClass())) return false;
        if(this.number == other.number() && this.title.equals(other.title()) && this.author.equals(other.author)){
            return true;
        }
        return false;

    }

    public String author() {
        return author;
    }
}
